package cn.com.jinhao.hotline.commons.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * hotline-spring-cloud
 * <p>Description: </p>
 *
 * @author ShaneMew
 * @version 1.0
 * @date 2020/6/2
 * @since 2020/6/2
 */
@Data
@ApiModel(value = "附件请求参数类")
public class AttachRequestVO {
    /**
     * 附件
     */
    @ApiModelProperty(value = "附件")
    @NotBlank(message = "附件不能为空")
    private String attachment;

    /**
     * 宿主编号
     */
    @ApiModelProperty(value = "宿主编号", hidden = true)
    private String hostCode;

    /**
     * 保存路径
     */
    @ApiModelProperty(value = "保存路径")
    @NotBlank(message = "保存路径(saveDir)不能为空")
    private String saveDir;

    /**
     * 新文件名
     */
    @ApiModelProperty(value = "新文件名")
    @NotBlank(message = "新文件名(newFileName)不能为空")
    private String newFileName;

    /**
     * 旧文件名
     */
    @ApiModelProperty(value = "旧文件名")
    @NotBlank(message = "旧文件名(oldFileName)不能为空")
    private String oldFileName;

    /**
     * 后缀名
     */
    @ApiModelProperty(value = "后缀名")
    @NotBlank(message = "后缀名(suffixName)不能为空")
    private String suffixName;

    /**
     * 文件大小
     */
    @ApiModelProperty(value = "文件大小")
    @NotBlank(message = "文件大小(fileSize)不能为空")
    @Min(value = 1,message = "文件大小(fileSize)不正确")
    private Long fileSize;

    /**
     * 附件类型
     */
    @ApiModelProperty(value = "附件类型")
    @NotBlank(message = "附件类型(fileType)不能为空")
    private String fileType;

    /**
     * MD5码
     */
    @ApiModelProperty(value = "MD5码")
    @NotBlank(message = "MD5码(fileMd5)不能为空")
    private String fileMd5;

    /**
     * 上传IP
     */
    @ApiModelProperty(value = "上传IP")
    @NotBlank(message = "上传IP(upIpAddress)不能为空")
    private String upIpAddress;

    /**
     * 上传时间
     */
    @ApiModelProperty(value = "上传时间")
    @NotBlank(message = "上传时间(upTime)不能为空")
    @Pattern(regexp = "((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$", message = "上传时间(upTime)日期格式不正确")
    private String upTime;

    /**
     * 上传部门编码
     */
    @ApiModelProperty(value = "上传部门编码")
    @NotBlank(message = "上传部门编码(upDeptCode)不能为空")
    @Pattern(regexp = "^[0-9]*$", message = "上传部门编码(upDeptCode)必须为数字")
    private String upDeptCode;

    /**
     * 上传部门
     */
    @ApiModelProperty(value = "上传部门")
    @NotBlank(message = "上传部门(upDept)不能为空")
    private String upDept;

    /**
     * 上传人员编码
     */
    @ApiModelProperty(value = "上传人员编码")
    @NotBlank(message = "上传人员编码(upOperatorCode)不能为空")
    @Pattern(regexp = "^[0-9]*$", message = "上传人员编码(upOperatorCode)必须为数字")
    private String upOperatorCode;

    /**
     * 上传人员
     */
    @ApiModelProperty(value = "上传人员")
    @NotBlank(message = "上传人员(upOperator)不能为空")
    private String upOperator;
}
